<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
    <%@page isELIgnored="false" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String userid = "";
if (request.getAttribute("userid") != null) {
	userid = request.getAttribute("userid").toString();
}
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
	<meta charset="utf-8">
	<title>档案表</title>
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link id="bootstrap-style" href="<c:url value="/css/bootstrap.min.css"/>" rel="stylesheet">
	<link href="<c:url value="/css/bootstrap-responsive.min.css"/>" rel="stylesheet">
	<link id="base-style" href="<c:url value="/css/style.css"/>" rel="stylesheet">
	<link id="base-style-responsive" href="<c:url value="/css/style-responsive.css"/>" rel="stylesheet">
	<link href="<c:url value="/css/index.css"/>" rel="stylesheet">
	<link rel="shortcut icon" href="<c:url value="/img/favicon.ico"/>">
	<link href="<c:url value="/css/page.css"/>" rel="stylesheet">
	<link rel="stylesheet" type="text/css" href="<c:url value="/css/jquery.datetimepicker.css"/>"/>
	<link href="<c:url value="/css/navuser.css"/>" rel="stylesheet">
	<link href="<c:url value="/css/but.css"/>" rel="stylesheet">
	<script src="<c:url value="/js/jquery-1.9.1.min.js"/>"></script>
	<script src="<c:url value="/js/jquery-migrate-1.0.0.min.js"/>"></script>
	<script type="text/javascript" src="<c:url value="/js/layer/layer.js"/>"></script>
	<script src="<c:url value="/js/laydate/laydate.js"/>"></script>
	<script src="<c:url value="/js/build/jquery.datetimepicker.full.js"/>"></script>
	<script src="<c:url value="/js/orgin.js"/>"></script>
	<script src="<c:url value="/js/filebut.js"/>"></script>
</head>
 <script type="text/javascript">
 function reback(){
     var url='<%=basePath%>user/index';
     parent.$("#mainFrame").attr("src",url);
 }
 
function lookimg(path){
    layer.open({
		title: '图片',
       type: 2,
       area: ['800px', '560px'],
       fixed: false, //不固定
       maxmin: true,
       content: '<%=basePath%>user/imgmain?path='+path
     });
}
function examine(){
	var formData = new FormData($("#userform")[0]);
	if(confirm("确定审核通过吗?")){
	    $.ajax({  
	         url: '<%=basePath%>user/examine',
	         type: 'POST',  
	         data: formData,  
	         async: false,  
	         cache: false,
	         contentType: false,  
	         processData: false,  
	         success: function (result) {
	               if("ok"==result){
	                   alert("审核成功");
	                   var url='<%=basePath%>user/index';
	                   parent.$("#mainFrame").attr("src",url);
	               }else if("no"==result){
	                   alert("审核失败");
	               }else if("mobileExist"==result){
	               	alert("手机号码已注册或上家公司未离职");
	               }else if("idcardExist" == result){
	               	alert("身份证号码已注册或上家公司未离职");
	               }
	         }
	    });
	}
}
 
 </script>
<body>
	
			
			<input type="hidden" id="dept" name="dept" value="${dept}"> 
			<div id="content" class="span10" style="width: 82%;background-color:#F9F9F9;">
				<div style="background-color:#FFF;">
				<div style="margin-top:-10px;margin-top:-10px;margin-bottom:20px;margin-left:20px;margin-right:20px;padding-top:20px;">
					<span style="color:#37c2c2">查看员工</span><button style="float:right;" class="but butreturn" type="button" id="select" onclick="reback();">返回</button>
				</div>
				<form name="userform" id="userform">
				<div style="margin-left:20px;">
					      员工工号：<span>${jobnumber }</span>
				</div>
					<input type="hidden" id="userid" name="userid" value="${userid}">
					<div class="row-fluid content-table">
						<table class="table table-striped table-bordered bootstrap-datatable">
							<thead><tr><td>基本信息</td></tr></thead>
							<tbody>
								<c:forEach items="${examineList }" var="examine">
									<tr>
										<td>${examine.viewName }</td>
										<td>${examine.oldData }</td>
										<td>${examine.newData }</td>
									</tr>
								</c:forEach>
							</tbody>
						</table>
					</div>
					<c:if test="${fn:length(educations) != 0 && fn:length(educationCopies) != 0}">
						<div class="row-fluid content-table">
						<table class="table table-striped table-bordered bootstrap-datatable">
							<thead><tr><td>学历信息</td></tr></thead>
							<tbody>
								<c:forEach items="${educations }" var="education">
									<tr>
										<td>毕业时间</td>
										<td>毕业院校</td>
										<td>毕业专业</td>
										<td>毕业证书编号 </td>
										<td>学位证书编号</td>
										<td>毕业证书图片</td>
										<td>学位证书图片</td>
									</tr>
									<tr>
										<td>${education.graduationtime }</td>
										<td>${education.universitie }</td>
										<td>${education.major }</td>
										<td>${education.educationNum }</td>
										<td>${education.academicdegreeNum }</td>
										<td><a onclick="lookimg('${education.educationPath}')">查看</a></td>
										<td><a onclick="lookimg('${education.educationPath}')">查看</a></td>
									</tr>
								</c:forEach>
							</tbody>
						</table>
						</div>
					<div class="row-fluid content-table">
						<table class="table table-striped table-bordered bootstrap-datatable">
							<thead><tr><td>学历更改</td></tr></thead>
							<tbody>
								<c:forEach items="${educationCopies }" var="educationCopy">
									<tr>
										<td>毕业时间</td>
										<td>毕业院校</td>
										<td>毕业专业</td>
										<td>毕业证书编号 </td>
										<td>学位证书编号</td>
										<td>毕业证书图片</td>
										<td>学位证书图片</td>
									</tr>
									<tr>
										<td>${educationCopy.graduationtime }</td>
										<td>${educationCopy.universitie }</td>
										<td>${educationCopy.major }</td>
										<td>${educationCopy.educationNum }</td>
										<td>${educationCopy.academicdegreeNum }</td>
										<td><a onclick="lookimg('${educationCopy.educationPath}')">查看</a></td>
										<td><a onclick="lookimg('${educationCopy.educationPath}')">查看</a></td>
									</tr>
								</c:forEach>
							</tbody>
						</table>
					</div>
					</c:if>
					
					<c:if test="${fn:length(emergencycontacts) != 0 && fn:length(emergencycontactCopies) != 0}">
						<div class="row-fluid content-table">
						<table class="table table-striped table-bordered bootstrap-datatable">
							<thead><tr><td>紧急联系人信息</td></tr></thead>
							<tbody>
								<c:forEach items="${emergencycontacts }" var="emergencycontact">
									<tr>
										<td>姓名</td>
										<td>关系</td>
										<td>联系人电话</td>
										<td>年龄</td>
										<td>工作单位</td>
									</tr>
									<tr>
										<td>${emergencycontact.name }</td>
										<td>${emergencycontact.relationship }</td>
										<td>${emergencycontact.mobile }</td>
										<td>${emergencycontact.age }</td>
										<td>${emergencycontact.positions }</td>
									</tr>
								</c:forEach>
							</tbody>
						</table>
					</div>
					<div class="row-fluid content-table">
						<table class="table table-striped table-bordered bootstrap-datatable">
							<thead><tr><td>紧急联系人修改</td></tr></thead>
							<tbody>
								<c:forEach items="${emergencycontactCopies }" var="emergencycontactCopy">
									<tr>
										<td>姓名</td>
										<td>关系</td>
										<td>联系人电话</td>
										<td>年龄</td>
										<td>工作单位</td>
									</tr>
									<tr>
										<td>${emergencycontactCopy.name }</td>
										<td>${emergencycontactCopy.relationship }</td>
										<td>${emergencycontactCopy.mobile }</td>
										<td>${emergencycontactCopy.age }</td>
										<td>${emergencycontactCopy.positions }</td>
									</tr>
								</c:forEach>
							</tbody>
						</table>
					</div>
					</c:if>
					
					
					
					<c:if test="${fn:length(workexperiences) != 0 && fn:length(workexperienceCopies) != 0}">
						<div class="row-fluid content-table">
						<table class="table table-striped table-bordered bootstrap-datatable">
							<thead><tr><td>工作经历信息</td></tr></thead>
							<tbody>
								<c:forEach items="${workexperiences }" var="workexperience">
									<tr>
										<td>开始时间</td>
										<td>结束时间</td>
										<td>单位名称</td>
										<td>部门职位</td>
										<td>薪资</td>
										<td>证明人</td>
										<td>联系电话</td>
									</tr>
									<tr>
										<td>${workexperience.starttime }</td>
										<td>${workexperience.endtime }</td>
										<td>${workexperience.unitname }</td>
										<td>${workexperience.positions }</td>
										<td>${workexperience.salary }</td>
										<td>${workexperience.witness }</td>
										<td>${workexperience.mobile }</td>
									</tr>
								</c:forEach>
							</tbody>
						</table>
					</div>
					<div class="row-fluid content-table">
						<table class="table table-striped table-bordered bootstrap-datatable">
							<thead><tr><td>工作经历信息修改</td></tr></thead>
							<tbody>
								<c:forEach items="${workexperienceCopies }" var="workexperienceCopy">
									<tr>
										<td>开始时间</td>
										<td>结束时间</td>
										<td>单位名称</td>
										<td>部门职位</td>
										<td>薪资</td>
										<td>证明人</td>
										<td>联系电话</td>
									</tr>
									<tr>
										<td>${workexperienceCopy.starttime }</td>
										<td>${workexperienceCopy.endtime }</td>
										<td>${workexperienceCopy.unitname }</td>
										<td>${workexperienceCopy.positions }</td>
										<td>${workexperienceCopy.salary }</td>
										<td>${workexperienceCopy.witness }</td>
										<td>${workexperienceCopy.mobile }</td>
									</tr>
								</c:forEach>
							</tbody>
						</table>
					</div>
					</c:if>
					
					<c:if test="${fn:length(userScanExamines) != 0 }">
						<div class="row-fluid content-table">
						<table class="table table-striped table-bordered bootstrap-datatable">
							<thead><tr><td>附件信息</td></tr></thead>
							<tbody>
								<c:forEach items="${userScanExamines }" var="userScanExamine">
									<tr>
										<td>${userScanExamine.scanType }</td>
										<td><a onclick="lookimg('${userScanExamine.oldFilePath }')">查看</a></td>
										<td><a onclick="lookimg('${userScanExamine.newFilePath }')">查看</a></td>
									</tr>
								</c:forEach>
							</tbody>
						</table>
					</div>
					</c:if>
					
					<c:if test="${not empty userPrivate && not empty privateCopy}">
						<div class="row-fluid content-table">
						<table class="table table-striped table-bordered bootstrap-datatable">
							<thead><tr><td>私密信息</td></tr></thead>
							<tbody>
								<tr>
									<td>公积金号</td>
									<td>社保号</td>
									<td>工资卡号</td>
									<td>工资卡银行</td>
									<td>银行卡图片</td>
								</tr>
								<tr>
									<td>${userPrivate.accumulationno }</td>
									<td>${userPrivate.securityno }</td>
									<td>${userPrivate.bankcardno }</td>
									<td>${userPrivate.bankname }</td>
									<td><a onclick="lookimg('${userPrivate.bankpath }')">查看</a></td>
								</tr>
							</tbody>
						</table>
					</div>
					<div class="row-fluid content-table">
						<table class="table table-striped table-bordered bootstrap-datatable">
							<thead><tr><td>私密修改</td></tr></thead>
							<tbody>
								<tr>
									<td>公积金号</td>
									<td>社保号</td>
									<td>工资卡号</td>
									<td>工资卡银行</td>
									<td>银行卡路径</td>
								</tr>
								<tr>
									<td>${privateCopy.accumulationno }</td>
									<td>${privateCopy.securityno }</td>
									<td>${privateCopy.bankcardno }</td>
									<td>${privateCopy.bankname }</td>
									<td><a onclick="lookimg('${privateCopy.bankpath }')">查看</a></td>
								</tr>
							</tbody>
						</table>
					</div>
					</c:if>
			
				</form>
				<div class="row-fluid content-table">
					<table class="table  bootstrap-datatable" style=" border:none; border-spacing:0; border-collapse:collapse;margin:0;padding:0">
					  <tbody>
						<tr class="content-search" style="text-align: center;">
							<td colspan="6">
								<button class="but" id="examineUser" onclick="examine();">审核</button>
							</td>
						</tr>
					  </tbody>
				  </table>            
				</div>
			</div>
		</div>
</body>
</html>
